using SqlSugar;
using System;
using System.ComponentModel;

namespace ZR.Model.System
{
    /// <summary>
    /// 业务表元数据
    /// </summary>
    [SugarTable("table_metadata", "业务表名元数据")]
    public class TableMetadata
    {
        /// <summary>
        /// 主键
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnName = "id")]
        public long Id { get; set; }

        /// <summary>
        /// 完整表名
        /// </summary>
        [SugarColumn(ColumnName = "table_name", Length = 191)]
        [DisplayName("表名")]
        public string TableName { get; set; }

        /// <summary>
        /// 日期时间前缀 yyyyMMddHHmmss
        /// </summary>
        [SugarColumn(ColumnName = "date_prefix", Length = 14)]
        public string DatePrefix { get; set; }

        /// <summary>
        /// 日期前缀 yyyyMMdd
        /// </summary>
        [SugarColumn(ColumnName = "day_prefix", Length = 8)]
        public string DayPrefix { get; set; }

        /// <summary>
        /// 城市
        /// </summary>
        [SugarColumn(ColumnName = "city", Length = 50, IsNullable = true)]
        public string City { get; set; }

        /// <summary>
        /// 类型（PPI/DBS等）
        /// </summary>
        [SugarColumn(ColumnName = "type", Length = 10, IsNullable = true)]
        public string Type { get; set; }

        /// <summary>
        /// 库名
        /// </summary>
        [SugarColumn(ColumnName = "schema_name", Length = 64, IsNullable = true)]
        public string SchemaName { get; set; }

        /// <summary>
        /// 最近同步时间
        /// </summary>
        [SugarColumn(ColumnName = "sync_time")]
        public DateTime SyncTime { get; set; }
    }
}

